const express = require('express')
const {queryDBPromise} = require('../util/db')
const categoryRouter = express.Router()


/**
 * 分类列表
 */
categoryRouter.get('/categorys',(req,res)=>{
    const sql =  `SELECT id,name,url FROM category`
    queryDBPromise(sql).then(data=>{
        res.send({
            code:1,
            list:data
        })
    })
})

module.exports = {categoryRouter}